<!DOCTYPE html>
<html>
<head>
    <title>cropit</title>
    <!--<script src="__HJS__jquery.min.js"></script>-->
    <script src="__HUI__lib/jquery/1.9.1/jquery.min.js"></script>
    <script src="__HJS__jquery.cropit.js"></script>

    <style>
        .cropit-preview {
            background-color: #f8f8f8;
            background-size: cover;
            border:5px solid red;
            border-radius: 3px;
            margin-top: 7px;
            width: 100%;
            height: 300px;
        }

        .cropit-preview-image-container {
            cursor: move;
        }

        .image-size-label {
            margin-top: 10px;
        }

        input, .export {
            /*display: block;*/
        }

        button {
            margin-top: 10px;
            padding: 5px 20px;
            font-size: 14px;
            border: 0;
            background: #cc0000;
            font-weight: bold;
            color: #FFFFFF;
        }
        .btn{
            text-align: center;
        }
        .dis{
            margin-top: 10px;
            width: 100%;
        }
        .dis img{
            width: 100%;
        }
        .top{
            width: 100%;
            background: #f2f2f2;
            line-height: 50px;
            font-size: 25px;
            font-weight: bold;
            text-align: center;
        }
        .top a{
            text-decoration: none;
            float: left;
            margin-right: 20px;
        }
    </style>
</head>
<body>
<div class="top">
    <a href=""> </a>制作海报
</div>
<div class="image-editor">
    <div class="cropit-preview"></div>
    <div class="btn">
        <input type="file" class="cropit-image-input" >
        <input type="range" class="cropit-image-zoom-input"><br/>
        <button class="rotate-ccw">左旋</button>
        <button class="rotate-cw">右旋</button>
        <br/>

        <button class="export" style="width: 80%;line-height: 35px">生成海报</button>
    </div>
    <div class="dis">
        <img src="__HIMG__dis_II.jpg" alt=""/>
    </div>
</div>

<script>
    $(function () {
        $('.image-editor').cropit({
            imageState: {
                src: '__HIMG__bg.png'
            }
        });

        $('.rotate-cw').click(function () {
            $('.image-editor').cropit('rotateCW');
        });
        $('.rotate-ccw').click(function () {
            $('.image-editor').cropit('rotateCCW');
        });

        $('.export').click(function () {
            var imageData = $('.image-editor').cropit('export');
            window.open(imageData);
        });
    });
</script>
</body>
</html>
